using UnityEngine;
using System.Collections;

public class Snake : MonoBehaviour 
{
	private Transform [] bodyParts;
	private Transform thisTransform;
	
	public void Start ()
	{
		thisTransform = transform;
		
		bodyParts = new Transform [thisTransform.GetChildCount ()];

		for (int i = 0; i < bodyParts.Length; ++i)
			bodyParts [i] = thisTransform.GetChild (i);
	}
                            
	public void HeadEatingTail ()
	{
		foreach (Transform body in bodyParts)
			body.SendMessage ("BeginWheelMode");
	}
	
	public void HeadStoppedEating ()
	{
		foreach (Transform body in bodyParts)
			body.SendMessage ("StopWheelMode");
	}
}